import request from "@/utils/request";

// 获取商品列表
export const getAll = (title, page, pageSize) => 
  request.get(`/spu/list?title=${title}&page=${page}&pageSize=${pageSize}`)

// 新增商品
export const addApi = (data) => 
  request.post('/spu/add', data)

// 根据ID查询商品
export const queryByIdApi = (id) => 
  request.get(`/spu/${id}`)

// 更新商品
export const updateApi = (data) => 
  request.put('/spu', data)

// 删除商品
export const deleteApi = (id) => 
  request.delete(`/spu?id=${id}`)